/**
* \brief Multimethod implementation 
*	 with 'Visitor' design pattern.
*	 Source file with auxilliary classes - Visitor.
* \author Bartosz Kedra (bartosz.kedra@gmail.com)
*/
#include "Visitor.hpp"
#include "Figure.hpp"

void RectangleVisitor::visit(Circle &c)
{
	val = rec.intersect(c);
}

void RectangleVisitor::visit(Rectangle &r)
{
	val = rec.intersect(r);
}

void CircleVisitor::visit(Circle &c)
{
	val = cir.intersect(c);
}

void CircleVisitor::visit(Rectangle &r)
{
	val = cir.intersect(r);
}

void IntersectVisitor::visit(Circle& c)
{
	CircleVisitor visitor(c);
	figure.accept(visitor);
	val = visitor.val;
}

void IntersectVisitor::visit(Rectangle& r)
{
	RectangleVisitor visitor(r);
	figure.accept(visitor);
	val = visitor.val;
}	
